/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jefoutta
 */
import java.util.*;

public class JCFPriorityQueue<E> {
    PriorityQueue<Integer> queue;

    public JCFPriorityQueue(int limit){
        queue = new PriorityQueue(limit, new Comparator<Integer>(){

            public int compare(Integer x, Integer y){
                if (x < y)
                    return(1);
                if (x == y)
                    return(0);
                return(-1);
            }
        });
    }

    public void add(Integer value){
        queue.add(value);
    }

    public E remove(){
        return (E) queue.remove();
    }

    public boolean isEmpty(){
        return queue.isEmpty();
    }
}
